package org.example.back.mapper.advice;

import java.time.LocalDate;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface UserSleepAdviceMapper {

    String findAdvice(@Param("userId") Integer userId,
                      @Param("adviceType") String adviceType,
                      @Param("adviceDate") LocalDate adviceDate);

    void insertAdvice(@Param("userId") Integer userId,
                      @Param("adviceType") String adviceType,
                      @Param("adviceDate") LocalDate adviceDate,
                      @Param("content") String content);

    // 删除指定类型的所有缓存
    void deleteAdviceByType(@Param("adviceType") String adviceType);

    void deleteAdviceByUserAndType(@Param("userId") Integer userId,
                               @Param("adviceType") String adviceType);
}
